<%@ page pageEncoding="UTF-8" %>
<%@ page contentType="text/html; charset=UTF-8" %>

<jsp:directive.include file="includes/top.jsp" />
<!-- 自己的登录页面 -->
<div class="content">
  <div class="bgImg">
    <div class="tianping2">
      <img src="images/tianping2.png">
    </div>
  </div>

  <div class="form">
    <form:form method="post" id="fm1" commandName="${commandName}" htmlEscape="true">
      <!-- 选择用户 -->
      <div class="item">
        <div class="label"><button type="button" class="selectuserButton">选择用户</button></div>
      </div>

      <div id="loginType1" style="display: block">
        <!-- 用户名 -->
        <div class="item" style="padding-top:5px">
          <span class="label">
            <label for="username"><spring:message code="screen.welcome.label.netid" /></label>
          </span>
          <c:choose>
            <c:when test="${not empty sessionScope.openIdLocalId}">
              <strong><c:out value="${sessionScope.openIdLocalId}" /></strong>
              <input type="hidden" id="username" name="username" value="<c:out value="${sessionScope.openIdLocalId}" />" />
            </c:when>
            <c:otherwise>
              <spring:message code="screen.welcome.label.netid.accesskey" var="userNameAccessKey" />
              <form:input cssClass="required" cssErrorClass="error" id="username" size="25" tabindex="1" accesskey="${userNameAccessKey}" path="username" autocomplete="off" htmlEscape="true" placeholder="用户邮箱"/>
            </c:otherwise>
          </c:choose>
        </div>
        <!-- 密码 -->
        <div class="item" style="padding-top: 10px">
          <span class="label"><label for="password"><spring:message code="screen.welcome.label.password" /></label></span>
          <spring:message code="screen.welcome.label.password.accesskey" var="passwordAccessKey" />
          <form:password cssClass="required" cssErrorClass="error" id="password" size="25" tabindex="2" path="password"  accesskey="${passwordAccessKey}" htmlEscape="true" autocomplete="off" placeholder="密码"/>
        </div>
      </div>

      <div id="loginType2" style="display: none">
        <!-- 证书名称 -->
        <div class="item" style="padding-top:5px">
          <span class="label">
            <label for="username">C&nbsp;A&nbsp;证书:</label>
          </span>
          <input type="text" id="caUser" name="caUser" disabled="disabled" value="" placeholder="CA证书" style="width: 75%">
        </div>
        <!-- 证书密码 -->
        <div class="item" style="padding-top: 10px">
          <span class="label"><label for="password">证书密码:</label></span>
          <input type="password" id="caPwd" name="caPwd" value="" placeholder="证书密码" style="width: 75%">
        </div>
      </div>

      <div id="loginType3" style="display: none">
        <!-- 用户名 -->
        <div class="item" style="padding-top:5px">
          <span class="label">
            <label for="username">用&nbsp;户&nbsp;名&nbsp;:</label>
          </span>
          <spring:message code="screen.welcome.label.netid.accesskey" var="userNameAccessKey" />
          <form:input cssClass="required" cssErrorClass="error" id="username" size="25" tabindex="1" accesskey="${userNameAccessKey}" path="username" autocomplete="off" htmlEscape="true" placeholder="用户邮箱" style="width: 76%"/>
        </div>
        <!-- 密码 -->
        <div class="item" style="padding-top: 10px">
          <span class="label">
            <label for="password">密&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;码&nbsp;:</label>
          </span>
          <spring:message code="screen.welcome.label.password.accesskey" var="passwordAccessKey" />
          <form:password cssClass="required" cssErrorClass="error" id="password" size="25" tabindex="2" path="password"  accesskey="${passwordAccessKey}" htmlEscape="true" autocomplete="off" placeholder="密码" style="width: 75%"/>
        </div>
        <!-- 证书名称 -->
        <div class="item" style="padding-top:5px">
          <span class="label">
            <label for="username">C&nbsp;A&nbsp;证书:</label>
          </span>
          <input type="text" id="caUser" name="caUser" disabled="disabled" value="" placeholder="CA证书" style="width: 75%">
        </div>
        <!-- 证书密码 -->
        <div class="item" style="padding-top: 10px">
          <span class="label"><label for="password">证书密码:</label></span>
          <input type="password" id="caPwd" name="caPwd" value="" placeholder="证书密码" style="width: 75%">
        </div>
      </div>

      <!-- 提示消息 -->
      <div>
        <form:errors path="*" id="msg" cssClass="errors" element="div" htmlEscape="false" cssStyle="font-size: 14px;color: red" />
        <div id="errMsg" style="font-size: 14px;color: red"></div>
      </div>
      <!-- 记住用户名 -->
      <div class="checkbox" style="margin-top:5px;">
        <input type="checkbox" id="remember" style="width: 15px;height: 15px;vertical-align:top;margin-top:4px;"/><span style="font-size: 15px;">记住用户名</span>
      </div>
      <!-- 登录方式 -->
      <div style="margin-top:5px;">
        <select id="loginType" name="loginType" class="selectShow">
          <option value="1" selected="selected">默认登录1:用户名密码登录</option>
          <option value="2" >登录方式2:CA证书登录</option>
          <option value="3" >登录方式3:用户名密码+CA证书登录</option>
        </select>
      </div>

      <div id="cakeydiv" class="item" style="margin-top:1px;display: none">
        <input type="text" name="cakey" readonly  unselectable="on" value="CA证书姓名">
      </div>

      <div id="casecurediv" class="item" style="display: none">
        <div class="label">证书密码：</div>
        <input type="text" name="casecure" value="CA证书姓名">
      </div>

      <div>
        <section class="">
          <input type="hidden" name="lt" value="${loginTicket}" />
          <input type="hidden" name="execution" value="${flowExecutionKey}" />
          <input type="hidden" name="_eventId" value="submit" />
          <button type="button" class="submitclass" id="submitBtn">登录</button>
        </section>
      </div>
    </form:form>
  </div>
</div>


<jsp:directive.include file="includes/bottom.jsp" />
